Rebuild upsert metadata from validDocIds snapshot on reload for TTL tables#18860
Draft
deepthi912 wants to merge 1 commit into
Draft
Rebuild upsert metadata from validDocIds snapshot on reload for TTL tables#18860deepthi912 wants to merge 1 commit into
deepthi912 wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #18860 +/- ##
============================================
- Coverage 64.79% 64.79% -0.01%
+ Complexity 1322 1316 -6
============================================
Files 3393 3393
Lines 211265 211334 +69
Branches 33212 33236 +24
============================================
+ Hits 136896 136932 +36
- Misses 63320 63343 +23
- Partials 11049 11059 +10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…ables Reloading a segment of an upsert table with metadata TTL (metadataTTL or deletedKeysTTL) previously rescanned every doc and re-added every primary key, which resurrected keys the TTL had already expired or deleted, producing incorrect query results. With snapshots enabled, segment reload now rebuilds the upsert metadata from the persisted validDocIds snapshot (valid docs only): - normal reload: proceeds only when the segment CRC matches and a snapshot exists; otherwise it fails with an error pointing the operator to forceDownload. - forceDownload reload: always proceeds, using the snapshot if present (the operator accepts a possible CRC mismatch), otherwise a full scan. Segment commit and refresh paths are unchanged: only the reload path places a snapshot on the incoming segment, so they keep the regular full-scan behavior. This supersedes the earlier approach of blocking forceDownload reload at the controller for upsert/dedup TTL tables; that API-level check is removed. Backward-incompatible: a normal (non-forceDownload) reload of an upsert table with metadata TTL and snapshots enabled now fails when the segment CRC has changed or no validDocIds snapshot exists; use a forceDownload reload in that case.
c46bf01 to
8154665
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reloading a segment of an upsert table with metadata TTL (
metadataTTLordeletedKeysTTL) previously rescanned every doc and re-added every primary key,which resurrected keys the TTL had already expired or deleted — producing
incorrect query results.
With snapshots enabled, segment reload now rebuilds the upsert metadata from the
persisted
validDocIdssnapshot (valid docs only).Behavior (upsert + metadata TTL, snapshots enabled)
Segment commit and refresh paths are unchanged — only the reload path
places a snapshot on the incoming segment, so they keep the regular full-scan
behavior.
Notes
controller for upsert/dedup TTL tables; that API-level check is removed.
Backward-incompatible
A normal (non-forceDownload) reload of an upsert table with metadata TTL and
snapshots enabled now fails when the segment CRC has changed or no
validDocIdssnapshot exists; use a forceDownload reload in that case.